<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
    <script src="https://unpkg.com/vue-router/dist/vue-router.js"></script>

</head>
<body>

<div id="app">

</div>
<script>
    let local = localStorage;
    local.number = 13;
    local.name = "小黄";

    console.log(typeof local.name)
    console.log(typeof local.number)

    local.student = {
        id: 1,
        username: "zfy",
        age: 18,
    }
    console.log(typeof local.student)
    console.log(local.student)

    let student2 = {
        id: 2,
        username: "小黄",
        age: 13,
    }
    //存储对象类型的数据,需要将数据经行序列化
    local.stu = JSON.stringify(student2)
    //取出数据 将数据反序列化对象
    let stu2 = JSON.parse(local.stu)
    console.log(stu2.age)

    new Vue({
        el: "#app",
        data: {},
    })
</script>
</body>
</html>